package com.online.websocketcluster.entity;

import com.online.websocketcluster.conf.WebSocketServerEndpoint;

import javax.websocket.Session;
import java.io.Serializable;

/**
 * 心跳机制存储的实体类
 *
 * @author hsc
 * @create 2018-04-26 18:13
 */
public class HbEntity implements Serializable {

    public  HbEntity()
    {

    }

    public  HbEntity(Long hbTime, Session session, WebSocketServerEndpoint webSocketServerEndpoint)
    {
        this.hbTime = hbTime ;
        this.session = session ;
        this.webSocketServerEndpoint = webSocketServerEndpoint;
    }


    /**
     * 存储心跳时间用于心跳机制判断是否超时（默认系统时间）
     */
    private Long hbTime;

    /**
     * WebSocket 会话
     */
    private  Session session;


    /**
     * WebSocket 服务器端点
     */
    private WebSocketServerEndpoint webSocketServerEndpoint;

    public Long getHbTime() {
        return hbTime;
    }

    public void setHbTime(Long hbTime) {
        this.hbTime = hbTime;
    }

    public Session getSession() {
        return session;
    }

    public void setSession(Session session) {
        this.session = session;
    }
    public WebSocketServerEndpoint getWebSocketServerEndpoint() {
        return webSocketServerEndpoint;
    }

    public void setWebSocketServerEndpoint(WebSocketServerEndpoint webSocketServerEndpoint) {
        this.webSocketServerEndpoint = webSocketServerEndpoint;
    }

}
